Fix substrate calibration and add cube, slab and coco setup tools - #1
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce8ed0716c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| positive(wet, "Wet assembly mass"); | ||
| positive(volumeL, "Sample volume"); | ||
| positive(density, "Water density"); | ||
| if (wet < dry) throw new Error("Wet mass cannot be below dry mass."); |
There was a problem hiding this comment.
Reject zero-VWC calibration records
When the wet and dry assembly masses are equal, this check accepts the inputs, returns a 0% VWC result, and enables saving the calibration record. The corresponding firmware capture rejects v <= 0 in tdr_sdi12_core.yaml, so a record produced by the setup desk cannot be entered as A, B, or C; reject equal masses here to keep the setup workflow consistent with the device.
Useful? React with 👍 / 👎.
|
|
||
| - binary_sensor.tdr_sensor_vwc_ready | ||
| - binary_sensor.tdr_sensor_sensor_data_fresh | ||
| - sensor.tdr_sensor_calibration_status |
There was a problem hiding this comment.
Use text_sensor domains for textual entities
When this dashboard is pasted into Home Assistant, Calibration status is created by the core package as a text_sensor, so sensor.tdr_sensor_calibration_status does not exist. The same domain mismatch affects sensor.tdr_sensor_water_trend on line 22 and sensor.tdr_sensor_last_calibration_action on line 62, leaving all three dashboard rows unavailable; reference them with the text_sensor. domain.
Useful? React with 👍 / 👎.
| sorting_group_id: sg_analytics | ||
| lambda: |- | ||
| if (!id(g_has_irrigated)) return NAN; | ||
| return (uint32_t)(millis()-id(g_last_irr_ms))/60000.0f; |
There was a problem hiding this comment.
Use a nonwrapping clock for irrigation age
If the device remains up for more than one 32-bit millis() period (about 49.7 days) without another detected wetting, this subtraction wraps modulo 2^32 and Time Since Irrigation drops back to a small value instead of continuing to increase. Unlike the short freshness and plateau timers, this duration is unbounded, so it needs a 64-bit monotonic timestamp or explicit saturation across repeated rollovers.
Useful? React with 👍 / 👎.
The existing configuration exposed generic VWC and an unsupported pore-EC blend as reliable measurements. This change separates a quick wet-reference index from weighed VWC, requires two reference points plus an independent third-point check, and withholds VWC during calibration, stale data and extrapolation. It also fixes flat-plateau detection, resets trends when measurement continuity changes, and prevents the CSV logger from presenting stale readings as new observations.
Adds an offline setup desk for cubes, shared slabs and coco containers, real metric block sizes, per-plant/zone volumes, weighed calibration records, placement drawings and actual-size print templates. Documentation, dashboards and migration notes now describe those measurements consistently. The irrigation blueprint requests a separately bounded controller shot with explicit enable/freshness gates.
Validation: 14 calculator tests, five repository checks, five logger tests and host assertions executing the actual firmware lambdas passed; all 11 device/factory/private+MQTT configurations validated; the Atom Lite factory firmware compiled with ESPHome 2026.8.2. Browser flows, CSV download, phone layout and A4 print geometry passed. All five factory board builds passed in CI, including artifact packaging. Physical probe calibration and controller commissioning remain installation checks; no device or live irrigation system was changed.